package com.solidumgame.locroninja.juego.ingredientes.choclo
{

	import com.solidumgame.locroninja.juego.Partida;
	import com.solidumgame.locroninja.juego.ingredientes.Ingrediente;
	import com.solidumgame.locroninja.juego.ingredientes.IngredienteNoCortado;
	
	import flash.geom.Vector3D;
	
	import libs.away3d.containers.ObjectContainer3D;
	import libs.away3d.core.base.Mesh;
	import libs.away3d.core.utils.Cast;
	import libs.away3d.events.MouseEvent3D;
	import libs.away3d.loaders.Collada;
	import libs.away3d.materials.BitmapMaterial;
	import libs.away3d.materials.Material;
	import libs.away3d.materials.PhongBitmapMaterial;
	import libs.away3d.primitives.Cube;
	import libs.jiglib.geometry.JBox;
	import libs.jiglib.physics.RigidBody;
	import libs.jiglib.plugin.away3d.Away3dMesh;

	public class Choclo extends IngredienteNoCortado
	{
		
		
		[Embed(source="./assets/texturas/ingredientes/Choclo.jpg")] // MIME-type important!
		private static var ChocloTextura : Class;
		
		[Embed(source="./assets/texturas/ingredientes/Choclo.dae",mimeType="application/octet-stream")] // MIME-type important!
		private static var ChocloDAE : Class;
		
		private static var material:Material = new BitmapMaterial(Cast.bitmap(ChocloTextura));
		
		public function Choclo()
		{
			super(ChocloCortadoTop,ChocloCortadoBot,33.5);
			
			this.valido = true;
	
			var choclo:ObjectContainer3D = Collada.parse(ChocloDAE,{ autoLoadTextures:false}); 
			
			(choclo.children[0] as Mesh).material = material;
			
			
			_modelo3D.addChild(choclo);
			//Creamos modelo de fisica
			_modeloFisica =  new JBox(new Away3dMesh(_modelo3D),30,30,60);
			
			//Tipo de colision			
			_modeloFisica.collisionType = 1;
			_modeloFisica.mass = 10;
			_modeloFisica.friction = 1;
			//_modeloFisica.restitution = .8;
			
		
			
		}
		
	}
}